package com.xiaozhen.common.core.domain.system;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaozhen.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * HISTORY
 *
 * @author zhenweisheng
 * @date 2021/8/17 10:24
 * @description:
 */
@Data
@TableName("sys_dept")
@ApiModel(description = "系统部门表")
public class SysDept extends BaseEntity {

    @TableId
    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "父部门ID")
    private Long parentId;

    @ApiModelProperty(value = "祖级列表")
    private String ancestors;

    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @ApiModelProperty(value = "显示顺序")
    private String orderNum;

    @ApiModelProperty(value = "负责人")
    private String leader;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "部门状态:0正常,1停用")
    private String status;

    @TableLogic
    @ApiModelProperty(value = "删除标志（0代表存在 1代表删除）")
    private String delFlag;

    @ApiModelProperty(value = "子部门")
    @TableField(exist = false)
    private List<SysDept> children = new ArrayList<>();
}
